package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.authorities.Role;

public class RoleMapper implements RowMapper<Role> {

	@Override
	public Role mapRow(final ResultSet result, final int row) throws SQLException {
	    
	    Role role = new Role();
		
	    role.setId(result.getInt("idRole"));
	    role.setName(result.getString("name"));
	    role.setEnabled(result.getBoolean("enabled"));
		
		return role;
	}

}
